const packageName = require('../../package.json').name;

// 判断是 qiankun 环境则增加路由前缀
let prefix = ''
if(window.__POWERED_BY_QIANKUN__){
    prefix = '/'+packageName
  }

const routes = [
    {
        path:prefix + "/test",
        name:"测试",
        component:() => import('@/pages/main/test.vue')
    },
    {
        path:prefix + "/organization",
        name:"组织管理",
        component:() => import('@/pages/organization/index.vue')
    } ,
    {
        path:prefix + '/factorInfo/:index/:index2', //  监测因素
        name:'factorInfo',
        component:() => import('@/pages/factorInfo/index.vue'),
        children:[
            {
                path: 'processMonitor', //  过程数据
                name:'processMonitor',
                component:() => import('@/pages/factorInfo/processMonitor/index.vue')
            }
        ]
    },
    {
        path:prefix + '/recordReport', //  数据报告
        name:'recordReport',
        component:() => import('@/pages/report/recordReport.vue')
    },
    {
        path:prefix + '/batchDelete', //  批量删除
        name:'batchDelete',
        component:() => import('@/pages/batchDelete/index.vue')
    },
    {
        path:prefix + '/warningInfo', //  告警信息
        name:'warningInfo',
        component:() => import('@/pages/warningInfo/warningInfo.vue')
    },
]

export default routes